package com.tentact.coolmeetingtest.vo;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 星环
 * @date 2023/1/10 14:59:31
 * @description
 */
public enum EmpState {
    WAITING(0,"待审核"),ACCEPTED(1,"审核通过"),REJECTED(2,"已拒绝");

    private int state;
    private String desc;
    private static final Map<Integer,EmpState> stateToEnumMap;
    static {
        stateToEnumMap = new HashMap<>();
        stateToEnumMap.put(WAITING.state, WAITING);
        stateToEnumMap.put(ACCEPTED.state, ACCEPTED);
        stateToEnumMap.put(REJECTED.state, REJECTED);
    }

    EmpState(int state, String desc) {
        this.state = state;
        this.desc = desc;
    }

    public static EmpState getByState(int state) {
        return stateToEnumMap.get(state);
    }

    public String getDesc(){
        return desc;
    }

    public int getState(){return state;}

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
